package com.boot.springboot.repository;



import com.boot.springboot.pojo.PendingShipment;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;


@Repository        //spring bean(数据访问层)
public interface PendingShipmentRepository extends CrudRepository<PendingShipment,Integer> {


    Optional<PendingShipment> findByGoodId(Integer goodId);

    void deleteByGoodId(Integer goodId);

    //POST和PUT是都没有用到键的；而在DELETE和GET中，用的是非主键，所以需要建立findByGoodId和deleteByGoodId
}
